import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
      activeName:'',
      taglist:[]
  },
  mutations: {
      handleTab(state,tabname){
        state.activeName=tabname
      },
      addTag(state,name){
        state.taglist.push(name)
      },
      closeTag(state,name){
        let i='';
        state.taglist.filter((item,index)=>{
          if(item==name){
             i=index
          }
        })
        state.taglist.splice(i,1)
      }
  },
  actions: {
  },
  modules: {
  }
})